package com.fengxing.ams.web.task.translator;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.fengxing.ams.pub.AMSException;

public class NationTranslator implements Translator {

	private static final Map<String, String> cache = new HashMap<String, String> ();
	static {
		cache.put("01","汉族");
		cache.put("02","蒙古族");
		cache.put("03","回族");
		cache.put("04","藏族");
		cache.put("05","维吾尔族");
		cache.put("06","苗族");
		cache.put("07","彝族");
		cache.put("08","壮族");
		cache.put("09","布依族");
		cache.put("10","朝鲜族");
		cache.put("11","满族");
		cache.put("12","侗族");
		cache.put("13","瑶族");
		cache.put("14","白族");
		cache.put("15","土家族");
		cache.put("16","哈尼族");
		cache.put("17","哈萨克族");
		cache.put("18","傣族");
		cache.put("19","黎族");
		cache.put("20","傈傈族");
		cache.put("21","佤族");
		cache.put("22","畲族");
		cache.put("23","高山族");
		cache.put("24","拉祜族");
		cache.put("25","水族");
		cache.put("26","东乡族");
		cache.put("27","纳西族");
		cache.put("28","景颇族");
		cache.put("29","柯尔族");
		cache.put("30","土族");
		cache.put("31","达斡尔族");
		cache.put("32","仫佬族");
		cache.put("33","羌族");
		cache.put("34","布朗族");
		cache.put("35","撒拉族");
		cache.put("36","毛难族");
		cache.put("37","仡佬族");
		cache.put("38","锡伯族");
		cache.put("39","阿昌族");
		cache.put("40","普米族");
		cache.put("41","塔吉克族");
		cache.put("42","怒族");
		cache.put("43","乌孜别克族");
		cache.put("44","俄罗斯族");
		cache.put("45","鄂温克族");
		cache.put("46","崩龙族");
		cache.put("47","保安族");
		cache.put("48","裕固族");
		cache.put("49","京族");
		cache.put("50","塔塔尔族");
		cache.put("51","独龙族");
		cache.put("52","鄂伦春族");
		cache.put("53","赫哲族");
		cache.put("54","门巴族");
		cache.put("55","珞巴族");
		cache.put("56","基诺族");
		cache.put("97","其他");
		cache.put("98","外国血统中国籍人士");
	}
	private static final String message = "期望值："+StringUtils.join(cache.keySet(), '|')+"， 而实际值：";
	@Override
	public String translate(String input) {
		if (!cache.containsKey(input))
			throw new AMSException(message+input);
		return cache.get(input);
	}

}
